import java.util.Scanner;

public class J07arraychushihua {
    public static void main(String[] args) {
        //静态初始化，简写，语法糖
        int[] arr1 = {1,4,6};

        //完整写法。静态初始化
        int[] arr2 = new int[]{2,4,7};
        System.out.println(arr2[1]);//4
        System.out.println("arr2[2] = " + arr2[2]);

        String[] strArr = new String[]{"qq","tt"};
//        Scanner[] scArr = new Scanner[]{};

//        arr2 = {3,6};
        arr2 = new int[]{};

        System.out.println("==动态初始化==");
        int[] arr100 = new int[5];
        //数组有默认值，int = 0
        System.out.println("arr100[2] = " + arr100[2]);

        byte[] bArr = new byte[3];

        char[] cArr = new char[2];
        System.out.println(cArr[0]);

        boolean[] b100Arr = new boolean[2];
        System.out.println("b100Arr[0] = " + b100Arr[0]);
    }
}

class J07null{
    public static void main(String[] args) {
//        String s1;
        //空
        String s1 = null;
        System.out.println("s1 = " + s1);

        String[] sArr = new String[2];
        System.out.println("sArr[0] = " + sArr[0]);
    }
}
